home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacHack 1997
/
MacHack 1997.toast
/
Hacks
/
Hacks ’96
/
Audio dcmds
/
Audio CD dcmds.sit
/
Audio CD dcmds.π
/
Think Put Lib source
/
PutSDec.c
< prev
next >
Wrap
Text File
|
1994-06-12
|
386b
|
22 lines
void PutChar(char c);
void PutText(const char* s, int len );
void __DecToText (unsigned long dec, char* str );
void PutSDec(signed long i)
{
Boolean isNeg;
int n = 0;
char* str = "0000000000";
if ( isNeg = ( i < 0 ) )
i = -i;
__DecToText (i, str );
while ( str[n] == '0' && n<9 )
n++;
PutChar( '#' );
if ( isNeg ) PutChar( '-' );
PutText( &str[n], 10-n );
}